import * as types from './mutations_types';

export default {
	[types.SHOW_LOADING](state) {
		state.loading = true;
	},

	[types.HIDE_LOADING](state) {
		state.loading = false;
	},

	[types.TOAST](state, param) {
		state.toastData = { ...param, visible: true };
	},

	[types.CTRL_CUSTOMER](state, param) {
		state.customerData = param;
	},

	[types.CTRL_NOTICE](state, param) {
		state.noticeVisible = param;
	},

	[types.CTRL_TABBAR](state, param) {
		state.tabData = Object.assign({ ...state.tabData, ...param });
	},

	[types.USER_DATA](state, param) {
		state.userData = param;
	},

	[types.HEADER_DATA](state, param) {
		state.headerData = param;
	}
};
